package com.jiukuaidao.zhulin.module;

import android.os.CountDownTimer;

/**
 * Author : PaiTaSuo
 * Date : 2016/5/31
 * Description :
 */
public class MyCount extends CountDownTimer {
    public CommContract.CodeView codeView;

    public MyCount(long millisInFuture, long countDownInterval, CommContract.CodeView codeView) {
        super(millisInFuture, countDownInterval);
        this.codeView = codeView;

    }

    @Override
    public void onTick(long millisUntilFinished) {
        codeView.codeBtn().setClickable(false);
//        codeView.codeBtn().setBackgroundResource(R.drawable.bg_gray_white_unselect);
//        codeView.codeBtn().setTextColor(AppContext.getContext().getResources().getColor(R.color.comm_assistbody));
        codeView.codeBtn().setText(millisUntilFinished / 1000 + "秒");
    }

    @Override
    public void onFinish() {
        codeView.codeBtn().setClickable(true);
        codeView.codeBtn().setText("获取验证码");
//        codeView.codeBtn().setBackgroundResource(R.drawable.bg_yellow_white);
//        codeView.codeBtn().setTextColor(AppContext.getContext().getResources().getColor(R.color.yellow));

    }
}
